<template>
	<div class="homeTask">
		<el-table
		:data="tableData"
		border
		:show-header="false"
		empty-text="暂无任务"
		@row-click="rowClick"
		style="width:100%;margin-top: -1px;">
			<el-table-column align="center">
				<template slot-scope="scope" v-for="(item) in tableData">
					<div style="text-align: left;width: 360px;overflow: hidden;height: 23px;line-height: 23px;font-size: 13px;cursor: pointer;">
						<div style="float: left;color:#E6480C;">【{{scope.row.applyType|dictName("SMP0009")}}】</div>
						<div style="margin-left: 40px;">{{scope.row.qmsName}}</div>
					</div>
					<div style="text-align: left;width: 360px;overflow: hidden;height: 24px;line-height: 24px;margin-left: 7px;font-size: 12px;cursor: pointer;">
						<div style="float: left;">{{scope.row.applyUser|getUserChinesName}}</div>
						<div style="margin-left: 50px;">{{scope.row.applyDate}}</div>
					</div>
				</template>
			</el-table-column>
		</el-table>
	</div>
	
</template>

<script>
	"use strict";
	import {
		myTask
	} from '@/api/process.js';
	export default {
		data() {
			return {
				
				tableData:[],
				query: {
					body: {
						roleName: "",
						id: ""
					},
					pageNum: 1,
					pageSize: 5
				}
			};
		},

		created() {
			this.getList();
		},
		methods: {
			
			getList() {
				myTask(this.query).then(response => {
					this.tableData = response.data.extend.list
				}).catch(error => {
					console.info("失败");
					console.info(error.message);
				});
			},
			
			rowClick(row){
				let obj ={};
				Object.assign(obj,row);
				if(row.taskkey=='Examine'){
					this.$router.push({name:'processExamine',query:obj})
				}else if(row.taskkey=='AcceptDemand'){
					this.$router.push({name:'processAccept',query:obj})
				}else if(row.taskkey=='Reassignment'){
					this.$router.push({name:'processReassignment',query:obj})
				}else if(row.taskkey=='DevelopmentConfirm'){
					this.$router.push({name:'processDevelop',query:obj})
				}else if(row.taskkey=='demandApplication'){	//工单申请跳转到申请页面
					this.$router.push({name: 'demandApplication',query:obj})
				}else  if(row.taskkey=='ServerSystemExamine'){	//工单申请跳转到申请页面
					this.$router.push({name: 'processServerSystemExamine',query:obj})
				}else  if(row.taskkey=='EnvAdminExamine'){	//测试管理员审批
					this.$router.push({name: 'processEnvAdminExamine',query:obj})
				}
				
			}
		},
	}
</script>

<style>
	
.homeTask .el-table{
		border-width: 0;
}
 .homeTask{
		margin-top:1px;
		margin-right: -1px;
} 
.homeTask .el-table .cell{
	padding:0 2px;
}
.homeTask  .el-table--border .el-table__cell:first-child .cell{
	padding-left: 0;
}

.homeTask .el-table .el-table__cell{
		padding: 8px 0;
	}
	.homeTask .el-table td.el-table__cell, .esbTop10 .el-table th.el-table__cell.is-leaf{
		border-bottom: 1px dashed #E8EAEC;
	}
	
	.homeTask  .el-table--border .el-table__cell, .homeTask .el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed {
	  border-right: 1px solid #FFF;
	}
</style>